package com.googlecode.gwtbb.client.shared.entity.forum;

import com.googlecode.gwtbb.client.shared.entity.properties.HasId;

import java.io.Serializable;
import java.util.Date;

/**
 * @author Abraham Grief
 * @version $Id$
 * @since Apr 16, 2008
 */
public class Forum extends ForumBase implements HasId {
	private Info info;

	public Forum() {
	}

	public Forum(Long forumId, String name, String description, boolean listed, boolean deleted, Date snapDate) {
		super(forumId, name, description, listed, deleted, snapDate);
	}

	public Info getInfo() {
		return info;
	}

	public void setInfo(Info info) {
		this.info = info;
	}

	public Long getId() {
		return forumId;
	}

	public void setId(Long id) {
		forumId = id;
	}

	/**
	 * Additional info that may be returned with the forum when pulling from the db.
	 */
	public static class Info implements HasId, Serializable {
		private Long forumId;
		private int numPosts;
		private int numThreads;
		private Long lastPostId;
		private Post lastPost;

		public Long getForumId() {
			return forumId;
		}

		public void setForumId(Long forumId) {
			this.forumId = forumId;
		}

		public Post getLastPost() {
			return lastPost;
		}

		public void setLastPost(Post lastPost) {
			this.lastPost = lastPost;
		}

		public Long getLastPostId() {
			return lastPostId;
		}

		public void setLastPostId(Long lastPostId) {
			this.lastPostId = lastPostId;
		}

		public int getNumPosts() {
			return numPosts;
		}

		public void setNumPosts(int numPosts) {
			this.numPosts = numPosts;
		}

		public int getNumThreads() {
			return numThreads;
		}

		public void setNumThreads(int numThreads) {
			this.numThreads = numThreads;
		}

		public Long getId() {
			return forumId;
		}

		public void setId(Long id) {
			forumId = id;
		}
	}
}
